/*
 * Phase.h
 *
 *  Created on: 23 May 2011
 *      Author: allan
 */

#ifndef PHASE_H_
#define PHASE_H_

// C++ includes
#include <iostream>
#include <memory>
using namespace std;

// GeoReact includes
#include "Solution.h"

class Phase
{
public:
	Phase();
	
	template<class SolutionType>
	Phase(const SolutionType& solution);
	
	const string
	GetName() const;
	
	const vector<string>
	GetSpecies() const;
	
	const VectorXd
	MolarFractions(const VectorXd& n) const;
	
	const VectorXd
	Concentrations(const VectorXd& n) const;
	
	const VectorXd
	ActivityCoefficients(double T, double P, const VectorXd& n) const;
	
	const VectorXd
	Activities(double T, double P, const VectorXd& n) const;
	
private:
	typedef std::shared_ptr<Solution> SolutionPtr;
	
private:
	SolutionPtr solution;
};

template<class SolutionType>
Phase::Phase(const SolutionType& solution)
{
	this->solution = SolutionPtr(new SolutionType(solution));
}

#endif /* PHASE_H_ */
